package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.AdminUserWorkRoomExportDTO;
import com.sc.nft.entity.UserWorkRoom;
import com.sc.nft.entity.dto.UserWorkRoomPageDTO;
import com.sc.nft.entity.vo.UserWorkRoomExcludeWhiteListRankVO;
import com.sc.nft.entity.vo.UserWorkRoomPageVO;
import com.sc.nft.entity.vo.WorkRoomExportVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * (UserWorkRoom)表数据库访问层
 *
 * @author wwc
 * @since 2023-07-18 17:25:09
 */
public interface UserWorkRoomMapper extends BaseMapper<UserWorkRoom> {

    /**
     * 分页获取数据
     *
     * @param toMp
     * @param userWorkRoomPageDTO
     * @return
     */
    Page<UserWorkRoomPageVO> selectPageList(Page toMp, @Param("userWorkRoomPageDTO") UserWorkRoomPageDTO userWorkRoomPageDTO);



    /**
     * 获取指定集合中包含多少个社区网点
     *
     * @param userId
     * @return
     */
    Integer getsHowManyCommunityOutletsAreIncludedInTheSpecifiedCollection(@Param("userId") Long userId);

    /**
     * 获取最近的网点用户id
     * @param id
     * @return
     */
    Long accessTheNearestCityServiceCenter(Long id);


    /**
     * 社区工作室导出
     * @return
     */
    List<WorkRoomExportVO> workRoomExport();

    AdminUserWorkRoomExportDTO getDataByUserId(@Param("userId") Long userId);

    void insertUserWorkRoomDataTemp(@Param("userId") Long userId, @Param("name")String name, @Param("userTel")String userTel, @Param("underResident")String underResident, @Param("nftCost")String nftCost
            , @Param("nftIssuePrice")String nftIssuePrice, @Param("underMeltCost")String underMeltCost,@Param("validUser") String validUser, @Param("userTradeNum")Integer userTradeNum,
                                    @Param("firstIssueNum")Integer firstIssueNum,@Param("secondIssueNum") Integer secondIssueNum);

    List<AdminUserWorkRoomExportDTO> getDataList();
    /**
     * 获取排除社区工作室和城市服务中心的用户
     * @param userId
     * @param exclude
     * @return
     */
    List<Long> getUsersWhoExcludeUsersFromCommunityStudiosAndCityServiceCenters(@Param("userId") Long userId, @Param("exclude") Boolean exclude);
    /**
     * 获取排除白名单排名的用户(该方法专为社区升降级进行服务,禁止他用)
     * @return
     */
    List<UserWorkRoomExcludeWhiteListRankVO> getUserWorkRoomExcludeWhiteListRank();

    /**
     * 获取活动期间内国库功能新增的用户数
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    Integer getUserWorkRoomExcludeExchequerList(@Param("userId") Long userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}
